<template>
  <div class="patientmyselfMain">
    <div class="patientmyselfMain_background">
      <div class="patientmyselfMain_top">
        <div class="patientmyselfMain_top_left">
          <div class="patientmyselfMain_top_left_img">
            <img src="@/assets/img/doctormyself/9.png" alt="" />
          </div>
          <div class="patientmyselfMain_top_left_name"><h3>{{ appuserInfo.name }}</h3></div>
        </div>
        <div class="patientmyselfMain_top_right">
          <van-icon name="edit" size=".8rem" @click="toEditorData" />
        </div>
      </div>
      <div class="patientmyselfMain_introduce">
        <div class="patientmyselfMain_introduce_box">
          <div class="patientmyselfMain_introduce_box_img">
            <img src="@/assets/img/patientmyself/2.png" alt="" />
          </div>
          <div class="patientmyselfMain_introduce_box_name">
            <h3>待付款</h3>
          </div>
        </div>
        <div class="patientmyselfMain_introduce_box">
          <div class="patientmyselfMain_introduce_box_img">
            <img src="@/assets/img/patientmyself/4.png" alt="" />
          </div>
          <div class="patientmyselfMain_introduce_box_name">
            <h3>已付款</h3>
          </div>
        </div>
        <div class="patientmyselfMain_introduce_box">
          <div class="patientmyselfMain_introduce_box_img">
            <img src="@/assets/img/patientmyself/5.png" alt="" />
          </div>
          <div class="patientmyselfMain_introduce_box_name"><h3>处方</h3></div>
        </div>
        <div class="patientmyselfMain_introduce_box">
          <div class="patientmyselfMain_introduce_box_img">
            <img src="@/assets/img/patientmyself/6.png" alt="" />
          </div>
          <div class="patientmyselfMain_introduce_box_name"><h3>客服</h3></div>
        </div>
      </div>
    </div>
    <div class="patientmyselfMain_middle">
      <div class="patientmyselfMain_box patientmyselfMainVisitrecord" @click="tovisits">
        <div class="patientmyselfMain_box_img">
          <img src="@/assets/img/patientmyself/7.png" alt="" />
        </div>
        <div class="patientmyselfMain_box_right">
          <div class="patientmyselfMain_box_right_top">就诊记录</div>
          <div class="patientmyselfMain_box_right_bot">查看就诊记录</div>
        </div>
      </div>
      <div class="patientmyselfMain_box patientmyselfMaineatingrecord" @click="tomedicineList">
        <div class="patientmyselfMain_box_img">
          <img src="@/assets/img/patientmyself/8.png" alt="" />
        </div>
        <div class="patientmyselfMain_box_right">
          <div class="patientmyselfMain_box_right_top">服药记录</div>
          <div class="patientmyselfMain_box_right_bot"></div>
        </div>
      </div>
      <div class="patientmyselfMain_box patientmyselfMainremindrecord" @click="toreminder">
        <div class="patientmyselfMain_box_img">
          <img src="@/assets/img/patientmyself/9.png" alt="" />
        </div>
        <div class="patientmyselfMain_box_right">
          <div class="patientmyselfMain_box_right_top">服药提醒</div>
          <div class="patientmyselfMain_box_right_bot"></div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>

import store from "@/store/index";
export default {
  name: "patientmyselfMain",
  store:store,
  data(){
    return{
      appuserInfo:{},
    }
  },
  created: function () {
    this.getUserInfo();
  },
  methods: {
    getUserInfo() {
      const storage = window.localStorage;
      const json = storage.getItem('appuserInfo');
      this.appuserInfo = JSON.parse(json)
      console.log(this.appuserInfo);
    },
    toEditorData() {
      this.$router.push({path:"/home/logout"});
    },
    tomedicineList() {
      this.$router.push({ path: "/home/medicineList" });
    },
    toreminder() {
      this.$router.push({ path: "/home/reminder" });
    },
    tovisits() {
      this.$router.push({ path: "/home/visitRecord" });
    },
  },
};
</script>

<style lang="scss" scope>
.patientmyselfMainVisitrecord {
  background-color: #fec8c8;
}
.patientmyselfMaineatingrecord {
  background-color: #d0feb8;
}
.patientmyselfMainremindrecord {
  background-color: #feb8f5;
}
.patientmyselfMain {
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  &_middle {
    padding: 0 30px;
  }
  &_background {
    padding: 30px 30px 20px 30px;
    background-image: linear-gradient(to bottom right, #7bc2ed, #1fe5c0);
  }
  &_box {
    margin-top: 20px;
    padding: 20px;
    height: 100px;
    display: flex;
    align-items: center;
    &_right {
      flex: 2;
      display: flex;
      overflow: hidden;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      &_top {
        font-size: 18px;
        font-weight: 550;
      }
      &_bot {
        margin-top: 5px;
        font-size: 16px;
      }
    }
    &_img {
      flex: 1;
      height: 80px;

      & img {
        width: 80px;
        height: 80px;
        object-fit: cover;
      }
    }
  }
  &_top {
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    &_left {
      height: 100%;
      display: flex;
      align-items: center;
      &_name {
        margin-left: 10px;
        & h3 {
          margin: 0;
          font-size: 18px;
          max-width: 150px;
        }
      }
      &_img {
        width: 60px;
        height: 60px;
        overflow: hidden;
        border-radius: 50%;
        background-color: #fff;
        overflow: hidden;
        & img {
          object-fit: cover;
          width: 100%;
          height: 100%;
        }
      }
    }
  }
  &_introduce {
    width: 100%;
    margin-top: 10px;
    display: flex;
    height: 60px;
    align-items: center;
    &_box {
      flex: 1;
      height: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-between;
      &_name {
        flex: 1;
        display: flex;
        align-items: center;
        & h3 {
          font-size: 14px;
          margin: 0;
        }
      }
      &_img {
        width: 40px;
        height: 40px;
        & img {
          width: 100%;
          height: 100%;
          object-fit: cover;
        }
      }
    }
  }
}
</style>
